const fields = [
  {
    dataIndex: 'index',
    key: 'index',
    title: '序号',
    width: 50,
    scopedSlots: {
      customRender: 'subscript'
    }
  },
  {
    dataIndex: 'category',
    key: 'category',
    title: '父级栏目名称',
    width: 250
  },
  {
    dataIndex: 'columnName',
    key: 'columnName',
    title: '介绍子栏目/指引名称',
    width: 150
  },
  {
    title: '操作',
    key: 'action',
    fixed: 'right',
    scopedSlots: {
      customRender: 'action'
    }
  }
]

const formRow = [
  {
    span: 10,
    label: '栏目名称',
    component: 'AInput',
    placeholder: '请输入栏目名称',
    prop: 'columnName',
    allowClear: true
  },
  {
    span: 12,
    label: '指引位置',
    component: 'ASelect',
    placeholder: '请选择指引位置',
    prop: 'category',
    loading: false,
    disabled: false,
    isCustomList: true,
    customRequestList(instance) {
      instance.loading = true
      instance.disabled = true
      setTimeout(() => {
        instance.disabled = false
        instance.loading = false
        instance.list = [
          { label: '维权保护', value: '维权保护' },
          { label: '公共服务', value: '公共服务' },
          { label: '信息运用', value: '信息运用' },
        ]
      }, 1000)
    },
    allowClear: true
  }
]

const slotOpt = [
  {
    slot: 'action',
    component: 'Action',
    list: [
      { name: '修改', cb: 'edit' },
      { name: '查看', cb: 'toDetail', divider: true }
    ]
  }
]

module.exports = {
  fields,
  formRow,
  slotOpt
}
